package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.wap.common.SqlName;
import com.financing.wap.dao.IDstUserIntegralFlowDao;
import com.financing.wap.dto.DstUserIntegralFlowDTO;
/**
 * dst_user_integral_flow  
 * 用户积分流水表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("dstUserIntegralFlowDao")
public class DstUserIntegralFlowDaoImpl extends BaseDaoImpl<DstUserIntegralFlowDTO, java.lang.Integer> implements IDstUserIntegralFlowDao {


	@Override
	public int insert(DstUserIntegralFlowDTO dstUserIntegralFlow) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.DstUserIntegralFlowSql.insert, dstUserIntegralFlow);
	}

	@Override
	public void update(DstUserIntegralFlowDTO dstUserIntegralFlow) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstUserIntegralFlowSql.update, dstUserIntegralFlow);
	}

	@Override
	public void updateForce(DstUserIntegralFlowDTO dstUserIntegralFlow) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstUserIntegralFlowSql.updateForce, dstUserIntegralFlow);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.DstUserIntegralFlowSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<DstUserIntegralFlowDTO> queryList(DstUserIntegralFlowDTO dstUserIntegralFlow) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.DstUserIntegralFlowSql.queryList, dstUserIntegralFlow);
	}

	@Override
	public int queryListCount(DstUserIntegralFlowDTO dstUserIntegralFlow) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.DstUserIntegralFlowSql.queryListCount, dstUserIntegralFlow);
	}

	@Override
	public DstUserIntegralFlowDTO loadById(Integer id) throws SQLException {
		return  (DstUserIntegralFlowDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.DstUserIntegralFlowSql.loadById,id);
	}

	@Override
	public Class<DstUserIntegralFlowDTO> getEntityClass() {
		return DstUserIntegralFlowDTO.class;
	}
 	
}
